/**
 * Nihongo Kiso — Auth & Registration UI/UX Pro Max Stylesheet
 * 
 * Provides unified, premium, responsive styling for:
 * - Login form & Student Portal [nk_auth]
 * - Registration form [nk_register]
 * - Reset Password & Forgot Password Modal
 * 
 * @package Nihongo_Kiso
 * @version 4.136.0
 */

/* === ROOT VARIABLES & TOKENS === */
:root {
    --nk-auth-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --nk-auth-primary: #4f46e5;
    --nk-auth-primary-hover: #4338ca;
    --nk-auth-primary-light: #eef2ff;
    --nk-auth-primary-glow: rgba(79, 70, 229, 0.28);
    --nk-auth-text-main: #0f172a;
    --nk-auth-text-muted: #64748b;
    --nk-auth-text-sub: #475569;
    --nk-auth-border: #e2e8f0;
    --nk-auth-border-focus: #4f46e5;
    --nk-auth-input-bg: #f8fafc;
    --nk-auth-card-bg: #ffffff;
    --nk-auth-card-shadow: 0 20px 45px -12px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.03);
    --nk-auth-radius-card: 22px;
    --nk-auth-radius-input: 12px;
}

/* === OUTER LAYOUT WRAPPER === */
.nk-auth-outer-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 40px 16px;
    box-sizing: border-box;
    font-family: var(--nk-auth-font);
    background: transparent;
}

/* === CARD CONTAINER === */
.nk-auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--nk-auth-card-bg);
    border: 1px solid var(--nk-auth-border);
    border-radius: var(--nk-auth-radius-card);
    box-shadow: var(--nk-auth-card-shadow);
    padding: 38px 34px;
    box-sizing: border-box;
    position: relative;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.nk-register-card {
    max-width: 520px;
}

/* === CARD HEADER & EMBLEM === */
.nk-auth-header {
    text-align: center;
    margin-bottom: 26px;
    position: relative;
}

.nk-auth-lang-picker {
    position: absolute;
    top: -12px;
    right: 0;
    z-index: 1000;
}

.nk-auth-emblem {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.8), 0 6px 18px rgba(79, 70, 229, 0.14);
}

.nk-auth-emblem .nk-emblem-icon {
    font-size: 32px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nk-auth-title {
    font-size: 23px;
    font-weight: 800;
    color: var(--nk-auth-text-main);
    margin: 0 0 8px 0;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

.nk-auth-sub {
    font-size: 14px;
    color: var(--nk-auth-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* === TABS SEGMENTED CONTROL === */
.nk-auth-tabs-nav {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 14px;
    margin-bottom: 24px;
    gap: 4px;
    border: 1px solid #e2e8f0;
}

.nk-auth-tab-btn {
    flex: 1;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--nk-auth-text-muted);
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
}

.nk-auth-tab-btn:hover {
    color: var(--nk-auth-text-main);
}

.nk-auth-tab-btn.active {
    background: #ffffff;
    color: var(--nk-auth-primary);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* === PANELS === */
.nk-auth-panel {
    display: none;
}

.nk-auth-panel.active {
    display: block;
    animation: nkAuthFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes nkAuthFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === GOOGLE AUTH BUTTON === */
.nk-google-auth-btn-wrap {
    margin-bottom: 20px;
}

.nk-google-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 18px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--nk-auth-radius-input);
    text-decoration: none;
    color: var(--nk-auth-text-main);
    font-weight: 600;
    font-size: 14.5px;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.nk-google-auth-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.nk-google-icon-box {
    display: flex;
    margin-right: 12px;
}

.nk-auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 18px 0 16px 0;
    color: #94a3b8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

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

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

/* === FORM INPUTS & LABELS === */
.nk-input-group {
    margin-bottom: 18px;
    text-align: left;
}

.nk-input-group label {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--nk-auth-text-sub);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.nk-req {
    color: #ef4444;
    font-weight: bold;
    margin-left: 2px;
}

.nk-input-hint {
    display: block;
    font-size: 12px;
    color: var(--nk-auth-text-muted);
    margin-top: 5px;
    line-height: 1.4;
}

.nk-input-group input[type="text"],
.nk-input-group input[type="email"],
.nk-input-group input[type="tel"],
.nk-input-group input[type="password"],
.nk-input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--nk-auth-radius-input);
    font-size: 14.5px;
    box-sizing: border-box;
    color: var(--nk-auth-text-main);
    background: var(--nk-auth-input-bg);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    line-height: 1.5;
}

.nk-input-group input:focus,
.nk-input-group select:focus {
    border-color: var(--nk-auth-border-focus);
    background: #ffffff;
    box-shadow: 0 0 0 3.5px var(--nk-auth-primary-glow);
}

/* === PASSWORD WRAP & EYE TOGGLE === */
.nk-password-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.nk-password-wrap input {
    padding-right: 48px !important;
    width: 100% !important;
}

.nk-toggle-pass {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 18px !important;
    line-height: 1 !important;
    opacity: 0.65;
    padding: 6px !important;
    border-radius: 8px;
    z-index: 5;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.nk-toggle-pass:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1) !important;
}

/* === EXTRA ROW & CHECKBOX === */
.nk-label-with-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nk-open-forgot-link {
    font-size: 12.5px;
    color: var(--nk-auth-primary);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease;
}

.nk-open-forgot-link:hover {
    text-decoration: underline;
    color: var(--nk-auth-primary-hover);
}

.nk-auth-extra-row {
    margin-bottom: 22px;
    display: flex;
    align-items: center;
}

.nk-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--nk-auth-text-sub);
    cursor: pointer;
    user-select: none;
}

.nk-checkbox-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--nk-auth-primary);
    cursor: pointer;
    margin: 0;
}

/* === PRIMARY SUBMIT BUTTON === */
.nk-auth-btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--nk-auth-radius-input);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--nk-auth-primary-glow);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    margin-top: 8px;
}

.nk-auth-btn-primary:hover {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.42);
}

.nk-auth-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--nk-auth-primary-glow);
}

.nk-auth-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* === ALERTS & MESSAGES === */
.nk-auth-alert {
    padding: 13px 16px;
    border-radius: var(--nk-auth-radius-input);
    font-size: 13.5px;
    line-height: 1.45;
    margin-bottom: 20px;
    font-weight: 600;
    display: none;
    text-align: left;
    box-sizing: border-box;
}

.nk-auth-alert.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.nk-auth-alert.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* === BOTTOM SWITCH LINK === */
.nk-auth-bottom-switch {
    text-align: center;
    margin-top: 22px;
    font-size: 13.5px;
    color: var(--nk-auth-text-muted);
}

.nk-auth-bottom-switch a {
    color: var(--nk-auth-primary);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
    margin-left: 4px;
}

.nk-auth-bottom-switch a:hover {
    text-decoration: underline;
    color: var(--nk-auth-primary-hover);
}

/* === MODAL FORGOT PASSWORD === */
.nk-forgot-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.nk-forgot-modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.nk-forgot-modal-box {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    padding: 34px 28px;
    border-radius: var(--nk-auth-radius-card);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 2;
    box-sizing: border-box;
    animation: nkModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes nkModalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.nk-forgot-close {
    position: absolute;
    top: 14px; right: 16px;
    background: none;
    border: none;
    font-size: 26px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}

.nk-forgot-close:hover {
    color: var(--nk-auth-text-main);
}

.nk-forgot-title {
    font-size: 21px;
    font-weight: 800;
    color: var(--nk-auth-text-main);
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

.nk-forgot-sub {
    font-size: 13.5px;
    color: var(--nk-auth-text-muted);
    margin: 0 0 22px 0;
    line-height: 1.5;
}

/* === ALREADY LOGGED IN CARD === */
.nk-already-logged {
    max-width: 460px;
    margin: 40px auto;
    padding: 38px 30px;
    background: #ffffff;
    border-radius: var(--nk-auth-radius-card);
    box-shadow: var(--nk-auth-card-shadow);
    text-align: center;
    border: 1px solid var(--nk-auth-border);
}

/* === MOBILE RESPONSIVE TWEAKS === */
@media (max-width: 520px) {
    .nk-auth-outer-wrap {
        padding: 20px 12px;
        min-height: auto;
    }
    .nk-auth-card {
        padding: 28px 20px;
        border-radius: 18px;
    }
    .nk-auth-lang-picker {
        top: -8px;
    }
    .nk-auth-emblem {
        width: 58px;
        height: 58px;
        margin-bottom: 12px;
    }
    .nk-auth-title {
        font-size: 20px;
    }
    .nk-auth-sub {
        font-size: 13px;
    }
    .nk-input-group input[type="text"],
    .nk-input-group input[type="email"],
    .nk-input-group input[type="tel"],
    .nk-input-group input[type="password"],
    .nk-input-group select {
        font-size: 16px !important; /* Mencegah auto-zoom di iOS Safari */
        min-height: 48px;
    }
    .nk-auth-btn-primary {
        min-height: 48px;
        font-size: 15px;
    }
}
