/*
 * ============================================================
 * Okoatime — Centralized Authentication CSS
 * Used by: login, register, forgot-password, reset-password,
 *          reset-success-mobile, confirm-password, verify-email
 * ============================================================
 */

/* ── Fonts ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* ── Body / Background ──────────────────────────────────────── */
body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #2E8B87 0%, #3FA9A4 25%, #5BC0BC 50%, #7DD3CF 75%, #9FE6E3 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
}

@keyframes gradientShift {
    0%   { background-position: 0%   50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0%   50%; }
}

/* ── Layout Wrappers ────────────────────────────────────────── */
.authentication-wrapper {
    width: 100%;
    max-width: 480px;   /* default — narrow pages (login, forgot, etc.) */
    padding: 1rem;
    margin: 0 auto;
}

.authentication-wrapper.auth-wide {
    max-width: 1100px;  /* register page — two-column */
}

.authentication-inner { width: 100%; }

/* ── Card ───────────────────────────────────────────────────── */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

.card-body { padding: 2.25rem 2.5rem; }

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

/* ── Logo ───────────────────────────────────────────────────── */
.app-brand { margin-bottom: 1.25rem; }

.app-brand-link {
    display: inline-block;
    transition: transform 0.3s ease;
}
.app-brand-link:hover { transform: scale(1.05) rotate(-1deg); }

.app-brand-link img {
    max-width: 130px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(63, 169, 164, 0.3));
    transition: filter 0.3s ease;
}
.app-brand-link:hover img {
    filter: drop-shadow(0 8px 20px rgba(63, 169, 164, 0.5));
}

/* ── Typography ─────────────────────────────────────────────── */
h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    background: linear-gradient(135deg, #3FA9A4 0%, #2E8B87 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
}

h5 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: #334155;
}

h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: #3FA9A4;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.card-body > p,
.auth-subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ── Form Labels ────────────────────────────────────────────── */
.form-label {
    font-weight: 600;
    color: #334155;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: block;
}

/* ── Form Controls ──────────────────────────────────────────── */
.form-control {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    font-family: 'DM Sans', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    background: #fff;
    width: 100%;
}

.form-control:focus {
    border-color: #3FA9A4;
    box-shadow: 0 0 0 3px rgba(63, 169, 164, 0.12);
    outline: none;
    transform: translateY(-1px);
}

.form-control::placeholder { color: #cbd5e1; font-size: 0.875rem; }

.form-control.is-invalid { border-color: #ef4444 !important; }

.invalid-feedback,
.text-danger {
    color: #ef4444;
    font-size: 0.775rem;
    margin-top: 0.3rem;
    display: block;
}

/* ── Password Toggle (input-group-merge) ────────────────────── */
.input-group-merge { position: relative; }

.input-group-merge .form-control { padding-right: 2.9rem; }

.input-group-merge .input-group-text {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
    color: #94a3b8;
    transition: color 0.2s ease;
    padding: 0;
}
.input-group-merge .input-group-text:hover { color: #3FA9A4; }

/* ── Address Input Group (icon + field + button) ────────────── */
.input-group:not(.input-group-merge) .input-group-text {
    position: static;
    transform: none;
    padding: 0.7rem 0.9rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-right: none;
    border-radius: 10px 0 0 10px;
    color: #3FA9A4;
}
.input-group:not(.input-group-merge) .form-control {
    border-left: none;
    border-radius: 0;
}
.input-group:not(.input-group-merge) .btn {
    border-radius: 0 10px 10px 0;
    border: 2px solid #e2e8f0;
    border-left: none;
    padding: 0.7rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ── Checkbox ───────────────────────────────────────────────── */
.form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.form-check-input:checked {
    background: linear-gradient(135deg, #3FA9A4 0%, #2E8B87 100%);
    border-color: #3FA9A4;
}
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(63, 169, 164, 0.12); }

.form-check-label {
    color: #64748b;
    font-size: 0.875rem;
    margin-left: 0.4rem;
    cursor: pointer;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, #3FA9A4 0%, #2E8B87 100%);
    border: none;
    border-radius: 10px;
    padding: 0.8rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(63, 169, 164, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    color: #fff;
}
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.5s ease;
}
.btn-primary:hover::before { left: 100%; }
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(63, 169, 164, 0.4);
    color: #fff;
}
.btn-primary:active { transform: translateY(0); }

.btn-outline-primary {
    border: 2px solid #e2e8f0;
    color: #64748b;
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: white;
}
.btn-outline-primary:hover {
    border-color: #3FA9A4;
    color: #3FA9A4;
}
.btn-check:checked + .btn-outline-primary {
    background: linear-gradient(135deg, #3FA9A4 0%, #2E8B87 100%);
    border-color: #3FA9A4;
    color: white;
}

.btn-outline-secondary {
    border: 2px solid #e2e8f0;
    color: #64748b;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}
.btn-outline-secondary:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    color: #334155;
}

/* ── Links ──────────────────────────────────────────────────── */
a {
    color: #3FA9A4;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}
a:hover { color: #2E8B87; text-decoration: none; }

/* ── Alert / Status ─────────────────────────────────────────── */
.alert-success {
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #3FA9A4 0%, #2E8B87 100%);
    color: white;
    padding: 0.9rem 1.1rem;
    font-size: 0.875rem;
    animation: slideDown 0.4s ease-out;
}
.alert-warning {
    border-radius: 10px;
    border: 1.5px solid #fbbf24;
    background: #fffbeb;
    color: #92400e;
    padding: 0.9rem 1.1rem;
    font-size: 0.875rem;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0);     }
}

/* ── Corporate Admin Note Banner ────────────────────────────── */
.corporate-admin-note {
    background: linear-gradient(135deg, rgba(63,169,164,0.08) 0%, rgba(46,139,135,0.12) 100%);
    border: 1.5px solid rgba(63, 169, 164, 0.35);
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
    font-size: 0.8rem;
    color: #2E8B87;
    margin-bottom: 0.85rem;
    display: none;
    line-height: 1.45;
}

/* ── Two-Column Register Grid ───────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
.form-grid-full { grid-column: 1 / -1; }

.left-column {
    padding-right: 1rem;
    border-right: 2px solid #e2e8f0;
}
.right-column { padding-left: 1rem; }

/* ── Decorative Blobs ───────────────────────────────────────── */
.decoration {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.12;
    animation: float 20s infinite ease-in-out;
}
.decoration-1 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, #3FA9A4, transparent);
    top: -90px; left: -90px;
}
.decoration-2 {
    width: 220px; height: 220px;
    background: radial-gradient(circle, #7DD3CF, transparent);
    bottom: -70px; right: -70px;
    animation-delay: 5s;
}
@keyframes float {
    0%, 100% { transform: translate(0, 0)   scale(1);   }
    33%       { transform: translate(25px, -25px) scale(1.08); }
    66%       { transform: translate(-25px, 25px) scale(0.94); }
}

/* ── Google Places Autocomplete ─────────────────────────────── */
.pac-container {
    z-index: 10000 !important;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-family: 'DM Sans', sans-serif;
}
.pac-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.875rem;
}
.pac-item:hover { background: #f8fafc; }
.pac-item:last-child { border-bottom: none; }
.pac-item-query { font-weight: 600; color: #334155; }
.pac-matched { color: #3FA9A4; font-weight: 700; }

/* ── SweetAlert / Modal z-index ─────────────────────────────── */
.swal2-container { z-index: 10000 !important; }
.modal           { z-index: 9999  !important; }
.modal-backdrop  { z-index: 9998  !important; }

/* ── Spacing helpers ────────────────────────────────────────── */
.mb-3 { margin-bottom: 0.9rem  !important; }
.mb-4 { margin-bottom: 1.1rem  !important; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 991px) {
    .form-grid { grid-template-columns: 1fr; gap: 0; }
    .left-column, .right-column { padding: 0; border: none; }
    .right-column { margin-top: 1rem; }
}

@media (max-width: 768px) {
    body { padding: 0.5rem 0; }
    .card-body { padding: 1.75rem 1.5rem; }
    h4 { font-size: 1.4rem; }
    .decoration { display: none; }
}

@media (max-width: 576px) {
    .authentication-wrapper { padding: 0.75rem; }
    .card { border-radius: 16px; }
    .card-body { padding: 1.5rem 1.25rem; }
    .app-brand-link img { max-width: 110px; }
    h4 { font-size: 1.2rem; }
    .form-control { font-size: 16px; } /* prevent iOS zoom */
    .btn-primary { padding: 0.85rem 1.25rem; font-size: 0.9rem; }
    .btn-outline-primary { font-size: 0.8rem; padding: 0.55rem 0.65rem; }
}

@media (max-width: 400px) {
    .card-body { padding: 1.25rem 1rem; }
    .app-brand-link img { max-width: 95px; }
    h4 { font-size: 1.1rem; }
}
