﻿/* Content/AuthForms.css – Pure modern auth forms (floating labels, consistent fields, no frameworks) */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.2);
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --danger: #dc2626;
    --radius: 0.5rem;
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

.form,
.content {
    min-height: 100%;
}

body {
    background: var(--gray-50);
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 54px);
    /* ← subtracts your header height */
    padding: 2rem 1rem 4rem;
    /* good breathing room */
    box-sizing: border-box;
}

.auth-card {
    background: white;
    border-radius: 0.875rem;
    box-shadow: var(--shadow-card);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem 2rem;
    border: 1px solid var(--gray-100);
}

.register-card {
    max-width: 620px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Mobile / smaller screens – prevent cutting off tall forms (like Register) */
@media (max-width: 768px) {
    .auth-page {
        min-height: calc(100vh - 3.13rem);
        padding: 1.5rem 1rem 5rem;
        /* more bottom space for keyboard + footer */
        align-items: flex-start;
        /* stops it from trying to center when content is tall */
    }

    .auth-card.register-card {
        max-width: 100%;
        /* full width on mobile */
    }
}

.form-field {
    position: relative;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 1rem 1rem 0.4rem;
    font-size: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: white;
    transition: var(--transition);
    outline: none;
    box-sizing: border-box;
}

.form-field input:focus,
.form-field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-field label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    color: var(--gray-500);
    font-size: 1rem;
    pointer-events: none;
    transition: var(--transition);
}

.form-field input:focus + label,
.form-field input:not(:placeholder-shown) + label,
.form-field select:focus + label {
    top: 0.35rem;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 3rem;
}

.auth-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 0.85rem;
    font-size: 1.05rem;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
}

.auth-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.field-validation-error,
.validation-summary-errors {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-small {
    color: var(--gray-500);
    font-size: 0.875rem;
    text-align: center;
}

.register-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.5rem;
}

.register-grid .full-width {
    grid-column: span 2;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.75rem 1.25rem;
        margin: 1rem;
    }
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select {
    height: 72px !important;
    padding: 1.1rem 1rem 0.4rem !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
    font-size: 1rem !important;
    background: white !important;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2) !important;
    outline: none !important;
}

.form-field input,
.form-field select {
    /*border-bottom: none !important;*/
    background-image: none !important;
}

.auth-btn {
    background: #2563eb !important;
    background-image: none !important;
    border: none !important;
}

.alert {
    position: relative;
    padding: 1rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-primary {
    color: #084298;
    background-color: #cfe2ff;
    border-color: #b6d4fe;
}


.auth-tabs {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.tab-link {
    color: #6b7280;
    font-weight: 500;
    text-decoration: none;
    padding-bottom: 0.5rem;
    position: relative;
    transition: color 0.2s;
}

.tab-link.active {
    color: #111827;
    font-weight: 600;
}

.tab-link.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #111827;
}


.register-3col-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem 1.5rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

.register-3col-grid .full-width {
    grid-column: 1 / -1;
}

.password-field.full-width {
    grid-column: span 2;
}

@media (max-width: 1023px) {
    .register-3col-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .register-3col-grid .full-width {
        grid-column: 1 / -1;
    }
}

@media (max-width: 639px) {
    .register-3col-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.register-form {
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
}

.register-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem 1.5rem;
}

.register-group.full-width > * {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .register-group.personal,
    .register-group.company {
        grid-template-columns: 1fr 1fr;
    }
    .register-group.company {
        grid-template-columns: repeat(3, 1fr);
    }
    .register-group.credentials {
        grid-template-columns: 1fr 1fr;
    }
    .register-group.credentials .password-field {
        grid-column: span 1;
    }
}


.form-field select {
    width: 100% !important;
    padding-right: 2.5rem !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
    font-size: 1rem !important;
    appearance: none;
    background: white url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%236b7280' d='M6 8.825L1.175 4 2.35 2.825 6 6.475l3.65-3.65L10.825 4z'/></svg>") no-repeat right 1rem center !important;
    background-size: 12px !important;
}

.form-field select::-ms-expand {
    display: none;
}

.form-field select + label {
    top: 1rem;
    font-size: 1rem;
    color: #9ca3af;
}

.form-field select:focus + label,
.form-field select:not([value=""]) + label,
.form-field select option:checked + label {
    top: -0.5rem !important;
    font-size: 0.75rem !important;
    color: var(--primary) !important;
    background: white !important;
    pointer-events: none;
}

.form-field select[value="English"] + label,
.form-field select[value="Swedish"] + label {
    top: -0.5rem !important;
    font-size: 0.75rem !important;
    color: var(--primary) !important;
    background: white;
}

.form-field select[value=""] + label {
    top: 1rem !important;
    font-size: 1rem !important;
    color: #9ca3af !important;
}

.password-toggle:hover {
    opacity: 0.75;
}

.eye-icon {
    width: 24px;
    object-fit: contain;
    display: block;
}

.eye-icon.show-icon {
    display: block;
}

.eye-icon.hide-icon {
    display: none;
}

.password-toggle[data-show="true"] .eye-icon.show-icon {
    display: none;
}

.password-toggle[data-show="true"] .eye-icon.hide-icon {
    display: block;
}

.password-toggle {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    width: 1.8rem;
    height: 1.8rem;
    cursor: pointer;
}

.password-toggle:hover {
    opacity: 0.8;
}

.eye-show {
    display: block;
}

.eye-hide {
    display: none;
}

.password-toggle.visible .eye-show {
    display: none;
}

.password-toggle.visible .eye-hide {
    display: block;
}

.password-field {
    position: relative;
}

.password-container {
    position: relative;
    /* ← this becomes the reference point for the eye */
    display: flex;
    flex-direction: column;
}

.password-container input {
    width: 100%;
    /* your existing input styles */
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    /* now relative to .password-container (which matches input height) */
    transform: translateY(-50%);
    z-index: 2;
    width: 1.8rem;
    height: 1.8rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

/* Icons inside the button */
.eye-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.eye-show {
    display: block;
}

.eye-hide {
    display: none;
}

.password-toggle[data-show="true"] .eye-show {
    display: none;
}

.password-toggle[data-show="true"] .eye-hide {
    display: block;
}

/* Validation message stays outside → doesn't affect eye position */
.field-validation-error {
    margin-top: 0.4rem;
    display: block;
    color: var(--danger);
    font-size: 0.875rem;
}


/* ── Modern Remember Me Checkbox ── */
.modern-checkbox {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 1rem 0 1.5rem;
    font-size: 1rem;
    color: var(--gray-700);
    user-select: none;
}

    .modern-checkbox input[type="checkbox"] {
        appearance: none;
        width: 22px;
        height: 22px;
        border: 2px solid var(--gray-300);
        border-radius: 5px;
        background: white;
        cursor: pointer;
        position: relative;
        flex-shrink: 0;
        transition: transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.18s ease, box-shadow 0.18s ease;
    }

        .modern-checkbox input[type="checkbox"]:focus {
            outline: none;
            box-shadow: 0 0 0 4px var(--primary-glow);
        }

        .modern-checkbox input[type="checkbox"]:checked {
            border-color: transparent;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            transform: scale(1.08);
            box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
        }

        .modern-checkbox input[type="checkbox"]:active {
            transform: scale(0.92);
        }

        /* Checkmark with pop-in animation */
        .modern-checkbox input[type="checkbox"]:checked::after {
            content: "";
            position: absolute;
            left: 5px;
            top: 1px;
            width: 7px;
            height: 11px;
            border: solid white;
            border-width: 0 2.5px 2.5px 0;
            transform: rotate(45deg) scale(0);
            transform-origin: center;
            animation: check-pop 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
        }

@keyframes check-pop {
    0% {
        transform: rotate(45deg) scale(0);
        opacity: 0;
    }

    50% {
        transform: rotate(45deg) scale(1.35);
        opacity: 1;
    }

    100% {
        transform: rotate(45deg) scale(1);
        opacity: 1;
    }
}

/* Label styling */
.modern-checkbox label {
    cursor: pointer;
    font-weight: 500;
}