/* =============================================
   AATOONS ONLINE — PUBLIC STYLESHEET v1.0.9
   ============================================= */

/* --- Base --- */
.aatoons-auth-wrap,
.aatoons-dashboard {
    color: #111827;
    font-family: inherit;
    line-height: 1.5;
}

[hidden] {
    display: none !important;
}

.aatoons-auth-wrap {
    box-sizing: border-box;
    margin: 4vh auto;
    max-width: 440px;
    padding: 16px;
    width: 100%;
}

/* --- Card / Panel / Tabs --- */
.aatoons-card,
.aatoons-panel,
.aatoons-tabs {
    background: #fff;
    border: 1px solid #d9dde3;
}

.aatoons-auth-form,
.aatoons-status-card {
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}

/* --- Headings --- */
.aatoons-auth-form h2,
.aatoons-panel h2 {
    color: #111827;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 20px;
}

.aatoons-panel h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 14px;
    color: #111827;
}

/* --- Labels (standalone, not inside .aatoons-grid) --- */
.aatoons-auth-form label:not(.aatoons-check),
.aatoons-profile-form > form > label,
.aatoons-profile-form > form > div > label,
.aatoons-change-password-form label {
    color: #1f2937;
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
}

.aatoons-auth-form label:not(.aatoons-check) > span:not(.aatoons-required),
.aatoons-auth-form label:not(.aatoons-check) > input,
.aatoons-auth-form label:not(.aatoons-check) > div {
    display: block;
    margin-top: 5px;
}

.aatoons-required {
    color: #e11d48;
    margin-left: 2px;
    font-weight: 700;
}

/* --- Inputs --- */
.aatoons-auth-form input:not([type="checkbox"]):not([type="radio"]),
.aatoons-profile-form input,
.aatoons-profile-form select,
.aatoons-change-password-form input {
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    color: #111827;
    display: block;
    font-size: 15px;
    padding: 10px 14px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    margin-top: 5px;
}

.aatoons-auth-form input:focus:not([type="checkbox"]):not([type="radio"]),
.aatoons-profile-form input:focus,
.aatoons-change-password-form input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.aatoons-auth-form input:disabled,
.aatoons-profile-form input:disabled {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

/* --- Checkbox row --- */
.aatoons-check {
    align-items: center;
    display: flex !important;
    gap: 8px;
    margin-bottom: 14px;
    font-weight: 600;
    font-size: 14px;
}

.aatoons-check input {
    margin: 0;
    width: auto;
    min-height: 0;
}

/* --- Buttons --- */
.aatoons-auth-form button[type="submit"],
.aatoons-profile-form button[type="submit"],
.aatoons-change-password-form button[type="submit"],
.aatoons-button,
.aatoons-logout {
    align-items: center;
    background: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 8px;
    color: #fff !important;
    cursor: pointer;
    display: inline-flex;
    font-size: 15px;
    font-weight: 700;
    justify-content: center;
    min-height: 44px;
    padding: 10px 20px;
    text-decoration: none;
    transition: background-color 0.18s, border-color 0.18s;
    width: 100%;
    box-sizing: border-box;
}

.aatoons-auth-form button[type="submit"]:hover,
.aatoons-profile-form button[type="submit"]:hover,
.aatoons-change-password-form button[type="submit"]:hover,
.aatoons-button:hover,
.aatoons-logout:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.aatoons-auth-form button:disabled,
.aatoons-profile-form button:disabled,
.aatoons-change-password-form button:disabled,
.aatoons-logout:disabled {
    cursor: wait;
    opacity: 0.7;
}

/* Secondary / outline button (Resend OTP) */
.aatoons-secondary {
    background: #fff !important;
    border: 1px solid #d0d5dd !important;
    color: #374151 !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    min-height: 38px;
    padding: 7px 14px;
    width: auto !important;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.aatoons-secondary:hover {
    background: #f9fafb !important;
    border-color: #9ca3af !important;
}

/* --- Links row below form --- */
.aatoons-auth-links {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-top: 18px;
    flex-wrap: wrap;
}

.aatoons-auth-links a {
    color: #2563eb;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.aatoons-auth-links a:hover {
    text-decoration: underline;
}

/* --- Two-column grid for paired fields --- */
.aatoons-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
    width: 100%;
}

.aatoons-grid.two {
    grid-template-columns: 1fr 1fr;
}

/* Labels inside a grid */
.aatoons-grid label {
    color: #1f2937;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    width: 100%;
    height: 100%;
}

.aatoons-grid label input,
.aatoons-grid label select,
.aatoons-grid label .aatoons-password-wrap {
    margin-top: 5px;
}

/* --- Password show/hide --- */
.aatoons-password-wrap {
    position: relative;
    display: block; /* block so it fills the label width */
    width: 100%;
}

.aatoons-password-wrap input {
    padding-right: 44px !important;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0 !important; /* margin applied on the wrap itself */
}

.aatoons-eye {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 3px !important;
    margin: 0 !important;
    cursor: pointer !important;
    color: #6b7280 !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    outline: none !important;
    min-height: auto !important;
    width: auto !important;
}

.aatoons-eye:hover {
    color: #111827 !important;
    background: transparent !important;
}

.aatoons-eye svg {
    display: block;
    pointer-events: none;
}

/* --- Alert box --- */
.aatoons-alert {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    color: #991b1b;
    margin-bottom: 16px;
    padding: 10px 14px;
    font-size: 14px;
}

.aatoons-alert.ok {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}

.aatoons-muted {
    color: #6b7280;
    font-size: 13px;
    margin: 6px 0;
}

/* --- OTP stage 2 --- */
.aatoons-stage-2 .aatoons-muted {
    margin: 8px 0;
}

.aatoons-stage-2 [data-resend] {
    margin-top: 8px;
}

/* --- OTP input: large centred digits --- */
.aatoons-auth-form input[name="otp"] {
    font-size: 22px !important;
    letter-spacing: 6px;
    text-align: center;
    font-weight: 700;
    padding: 12px 14px !important;
}

/* --- reCAPTCHA wrapper --- */
.aatoons-recaptcha-wrap {
    overflow: hidden;
    max-width: 100%;
}

.aatoons-invisible-recaptcha {
    display: inline-block;
}

/* --- Dashboard layout --- */
.aatoons-dashboard {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    margin: 0 auto;
    max-width: 1140px;
    padding: 16px;
}

.aatoons-tabs {
    align-self: start;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
}

.aatoons-tabs > div {
    padding: 14px 16px;
    font-weight: 700;
    font-size: 17px;
    color: #111827;
    border-bottom: 1px solid #d9dde3;
    background: #f8fafc;
}

.aatoons-tabs button {
    background: #fff;
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    padding: 13px 16px;
    text-align: left;
    width: 100%;
    transition: background 0.15s;
    min-height: auto;
    border-radius: 0;
    display: block;
}

.aatoons-tabs button:hover {
    background: #f3f4f6;
    color: #111827;
}

.aatoons-tabs button.active {
    background: #111827;
    color: #fff !important;
}

.aatoons-panel {
    background: #fff;
    border: 1px solid #d9dde3;
    border-radius: 8px;
    min-height: 380px;
    padding: 28px;
}

.aatoons-tab {
    display: none;
}

.aatoons-tab.active {
    display: block;
}

.aatoons-panel-head {
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    flex-wrap: wrap;
}

.aatoons-panel-head .aatoons-button {
    width: auto;
    min-height: 38px;
    font-size: 14px;
    padding: 8px 16px;
}

/* --- Course cards --- */
.aatoons-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.aatoons-course {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s;
}

.aatoons-course:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.aatoons-course-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.aatoons-course > div {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
}

.aatoons-course h3 {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.4;
}

.aatoons-course .aatoons-button {
    width: 100%;
    text-align: center;
    margin-top: auto;
    min-height: 40px;
    font-size: 14px;
}

/* Empty state */
.aatoons-empty {
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 32px 24px;
    text-align: center;
    color: #6b7280;
}

.aatoons-empty .aatoons-button {
    width: auto;
    margin-top: 12px;
    display: inline-flex;
}

.aatoons-status-card p {
    margin: 0 0 16px;
}

/* --- Notifications --- */
.aatoons-notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aatoons-notification-card {
    border-radius: 10px;
    padding: 16px;
    position: relative;
}

/* --- HR divider in profile --- */
.aatoons-tab hr {
    margin: 28px 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

/* --- Google Login Button --- */
.aatoons-auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 600;
}

.aatoons-auth-divider::before,
.aatoons-auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.aatoons-auth-divider span {
    padding: 0 12px;
}

.aatoons-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #374151;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    min-height: 44px;
    width: 100%;
    box-sizing: border-box;
    transition: background-color 0.2s, border-color 0.2s;
    margin-bottom: 8px;
}

.aatoons-google-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.aatoons-google-btn svg {
    flex-shrink: 0;
}

/* --- Login Form Specific Refinements --- */
.aatoons-login-form h2,
.aatoons-login-form .aatoons-alert,
.aatoons-login-form .aatoons-otp-status {
    text-align: center !important;
}

.aatoons-login-form label {
    text-align: left !important;
}

.aatoons-login-form input,
.aatoons-login-form input::placeholder {
    font-weight: 400 !important;
}

.aatoons-login-form h2 {
    margin-bottom: 8px;
}

.aatoons-login-desc {
    text-align: center;
    font-size: 14px;
    color: #4b5563;
    margin: 0 0 24px;
}

.aatoons-login-form label:not(.aatoons-check) {
    margin-bottom: 20px;
}

.aatoons-login-form input:not([type="checkbox"]):not([type="radio"]) {
    min-height: 48px;
    font-size: 16px; /* Prevents auto-zoom on iOS */
}

.aatoons-login-form button[type="submit"],
.aatoons-google-btn {
    min-height: 48px;
    margin-top: 8px;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 760px) {
    .aatoons-auth-wrap {
        padding: 12px; /* Reduced outer margin */
        margin: 2vh auto;
        max-width: 100%;
    }

    .aatoons-dashboard {
        grid-template-columns: 1fr;
        padding: 8px; /* Reduced outer margin */
        gap: 8px;
    }

    .aatoons-tabs {
        flex-direction: row;
        flex-wrap: wrap;
        border-radius: 8px;
    }

    .aatoons-tabs > div {
        width: 100%;
    }

    .aatoons-tabs button {
        flex: 1 1 calc(50% - 1px);
        border-right: 1px solid #e5e7eb;
        text-align: center;
        font-size: 13px;
        padding: 10px 8px;
    }

    .aatoons-panel {
        padding: 16px 12px; /* Reduced inner padding */
    }

    .aatoons-grid.two {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .aatoons-panel-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .aatoons-auth-links {
        flex-direction: column;
        gap: 8px;
        margin-top: 14px;
    }

    .aatoons-auth-form,
    .aatoons-status-card {
        padding: 28px 20px; /* Adjusted inner padding for mobile */
    }

    .aatoons-course-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

@media (max-width: 400px) {
    .aatoons-tabs button {
        flex: 1 1 100%;
    }
}
