/* Shared styles for the teacher Login and Register pages (teacher/login.php, teacher/register.php) */

/* Page card: narrow column on desktop, flat on phones */
.auth-card {
    max-width: 460px;
    margin: 1rem auto 2rem;
    padding: 2.25rem 2rem 1.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.auth-card h2 {
    margin: 0 0 1.5rem;
    font-size: 1.75rem;
    line-height: 1.25;
    text-wrap: balance;
}

/* Teacher icon above the title (teacher mode only) */
.auth-role-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 0.6rem;
    border-radius: 50%;
    background: #e8f0fe;
    color: #1a73e7;
}

/* "Are you a student?" box at the top (teacher/_auth_student_box.php): amber, so it reads as
   a sign and never competes with the blue Google button */
.auth-student-box {
    margin: 0 0 1.5rem;
    padding: 12px 14px;
    background: #fff8e1;
    border: 1px solid #f3d27a;
    border-radius: 10px;
}

.auth-student-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #6b4400;
}

/* Question and answer wrap as whole sentences on narrow phones, never mid-sentence */
.auth-student-part {
    display: inline-block;
}

/* Phones: one line from 375 px (EN, the longest, needs 314 px at 13 px); narrower phones wrap between the sentences */
@media (max-width: 600px) {
    .auth-student-box {
        padding: 10px 12px;
    }

    .auth-student-title {
        font-size: 13px;
    }
}

.auth-student-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
}

.auth-student-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 6px 14px;
    box-sizing: border-box;
    background: #fff;
    border: 1.5px solid #c27c00;
    border-radius: 8px;
    color: #7a4d00;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.auth-student-btn:hover {
    background: #fdecc0;
    color: #7a4d00;
}

.auth-student-btn:focus-visible,
.auth-student-link:focus-visible {
    outline: 3px solid rgba(194, 124, 0, 0.35);
    outline-offset: 2px;
}

.auth-student-link {
    font-size: 13px;
    font-weight: 500;
    color: #7a4d00;
    text-decoration: underline;
}

/* Guest "Ask AI" teaser only links to Register/Login and covers the fields on phones */
#ai-guest-launcher-container {
    display: none !important;
}

/* Inputs */
.modern-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font-size: 16px; /* 16px stops iOS from zooming in on focus */
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modern-input:focus {
    border-color: #1a73e7;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 231, 0.15);
}

.auth-card .form-group {
    margin-bottom: 1.1rem;
}

.auth-card .form-group > label {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.field-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 12.5px;
    color: #6b7280;
}

/* Google button */
.google-section {
    margin-bottom: 1.5rem;
}

.primary-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 52px;
    padding: 10px 18px;
    box-sizing: border-box;

    background-color: #1a73e7;
    color: #ffffff;
    border: none;
    border-radius: 10px;

    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;

    box-shadow: 0 2px 6px rgba(26, 115, 231, 0.25);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* Long labels ("Google ilə müəllim kimi qeydiyyatdan keç") wrap into two even lines, not one orphan word */
.primary-google-btn > span:last-child {
    text-wrap: balance;
}

.primary-google-btn:hover {
    background-color: #1557b0;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(26, 115, 231, 0.3);
}

.primary-google-btn:active {
    transform: scale(0.98);
}

.primary-google-btn:focus-visible {
    outline: 3px solid rgba(26, 115, 231, 0.4);
    outline-offset: 2px;
}

/* White tile behind the Google "G" */
.google-g {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #fff;
    border-radius: 50%;
}

.google-g-small {
    width: 22px;
    height: 22px;
}

.google-g-small svg {
    width: 15px;
    height: 15px;
}

.google-hint {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    margin: 0.6rem 0 0;
}

/* "or ... by email" divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.25rem;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    min-width: 24px;
    height: 1px;
    background: #e5e7eb;
}

/* Submit */
.modern-submit {
    width: 100%;
    min-height: 50px;
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
    font-weight: 600;
}

/* Field errors */
.form-error-message,
.error-text {
    color: #d9534f;
    font-size: 12.5px;
    margin-top: 5px;
    display: block;
}

.form-error-message:empty {
    display: none;
}

.input-error {
    border-color: #d9534f !important;
}

/* Password field with show/hide button */
.pw-field {
    position: relative;
}

.pw-field .modern-input {
    padding-right: 48px;
}

.togglePassword {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
}

.togglePassword:hover {
    color: #111827;
}

.togglePassword:focus-visible {
    outline: 2px solid #1a73e7;
}

.togglePassword .icon-eye-off,
.togglePassword.is-visible .icon-eye {
    display: none;
}

.togglePassword.is-visible .icon-eye-off {
    display: block;
}

/* "Already have an account? / No account?" line under the form */
.login-redirect {
    text-align: center;
    margin: 1.25rem 0 0;
    color: #555;
}

@media (max-width: 600px) {
    .auth-card {
        margin: 0 auto;
        padding: 0.5rem 0.25rem 1rem;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-card h2 {
        font-size: 1.5rem;
    }

    .primary-google-btn {
        gap: 10px;
        padding: 10px 14px;
        font-size: 15px;
    }

    .google-g {
        width: 28px;
        height: 28px;
    }

    .google-g svg {
        width: 18px;
        height: 18px;
    }

    .google-g.google-g-small {
        width: 22px;
        height: 22px;
    }

    .google-g-small svg {
        width: 15px;
        height: 15px;
    }
}
