/* login-modern.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body,
html {
    height: 100%;
    margin: 0;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    /* Prevent scrolling on the main page */
}

.split-screen {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* LEFT PANEL: Branding */
.branding-panel {
    width: 50%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    color: white;
    overflow: hidden;
    padding: 3rem 0 2rem;
    /* Gradient Animation setup */
    background: linear-gradient(135deg, #0e4b3e, #1a8e79, #70C059, #235790);
    background-size: 400% 400%;
    animation: gradientPulse 15s ease infinite;
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.branding-content {
    z-index: 2;
    text-align: center;
    padding: 0 2rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 0;
}

.branding-logo {
    width: 200px;
    height: 200px;
    max-width: 200px;
    aspect-ratio: 1 / 1;
    margin-bottom: 1.75rem;
    border-radius: 22%;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22), 0 4px 10px rgba(0, 0, 0, 0.14);
    object-fit: cover;
}

.branding-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.branding-subtitle {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.2;
    opacity: 1;
    margin: 0 auto 0.875rem;
}

.branding-subtitle span {
    display: block;
}

.branding-subtitle span:nth-child(1) { opacity: 0; animation: fadeInUp 0.55s ease 0.05s forwards; }
.branding-subtitle span:nth-child(2) { opacity: 0; animation: fadeInUp 0.55s ease 0.15s forwards; }
.branding-subtitle span:nth-child(3) { opacity: 0; animation: fadeInUp 0.55s ease 0.25s forwards; }

.branding-audience {
    font-size: 0.95rem;
    font-weight: 400;
    opacity: 0.78;
    margin: 0 auto;
    letter-spacing: 0.01em;
    max-width: 42ch;
    line-height: 1.45;
}

.branding-features {
    list-style: none;
    padding: 0;
    margin: 2.25rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    text-align: left;
    max-width: 420px;
}

.branding-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    font-size: 0.95rem;
    line-height: 1.45;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.branding-features li:nth-child(1) { animation-delay: 0.25s; }
.branding-features li:nth-child(2) { animation-delay: 0.4s; }
.branding-features li:nth-child(3) { animation-delay: 0.55s; }

.branding-feature-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    color: #fff;
    font-size: 0.85rem;
    margin-top: 1px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.branding-footer {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    z-index: 2;
    padding: 1.5rem 1rem 0;
}

.branding-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.15rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.branding-link:hover,
.branding-link:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.65);
    color: #fff;
    text-decoration: none;
    outline: none;
    transform: translateY(-1px);
}

.branding-link i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.branding-link:hover i,
.branding-link:focus-visible i {
    transform: translateX(3px);
}

.powered-by {
    font-size: 0.8rem;
    opacity: 0.7;
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.powered-by:hover {
    opacity: 1;
    color: #fff;
    text-decoration: underline;
}

/* Overlay pattern for texture (optional) */
.branding-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 1;
}

/* RIGHT PANEL: Forms */
.form-panel {
    width: 50%;
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Removed: justify-content: center.
       Reason: when the registration form is taller than the viewport
       (Start Your Journey has org-type cards + 5 inputs + terms + button =
       roughly 720px), justify-content: center positions the form ABOVE the
       visible area and overflow-y: auto can't recover content that's already
       laid out off-screen. margin:auto on .form-container below replaces it —
       it centers vertically when there's room, falls back to top-aligned
       (so the form is reachable via scroll) when there isn't. */
    padding: 4rem;
    position: relative;
    overflow-y: auto;
}

.form-container {
    width: 100%;
    max-width: 450px;
    margin: auto 0; /* See .form-panel comment — flex auto-margin centering. */
}

.form-header {
    margin-bottom: 2rem;
    text-align: left;
}

.form-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.form-subtitle {
    color: #666;
    font-size: 1rem;
}

.toggle-link {
    color: #1a8e79;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.toggle-link:hover {
    color: #0e4b3e;
    text-decoration: underline;
}

/* INPUT FIELDS */
.input-group {
    margin-bottom: 1.5rem;
    position: relative;
    opacity: 0;
    /* For animation */
    /* Animation definition */
    animation: fadeInUp 0.6s ease forwards;
}

/* Staggered delay for inputs (handled via nth-child in usage or general class) */
.input-group:nth-child(1) {
    animation-delay: 0.1s;
}

.input-group:nth-child(2) {
    animation-delay: 0.2s;
}

.input-group:nth-child(3) {
    animation-delay: 0.3s;
}

.input-group:nth-child(4) {
    animation-delay: 0.4s;
}

.input-group:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control-custom {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #f8f9fa;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control-custom:focus {
    background-color: #fff;
    border-color: #1a8e79;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(26, 142, 121, 0.25);
}

.password-wrapper {
    position: relative;
}

.toggle-password-icon {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    z-index: 10;
}

.btn-primary-custom {
    display: block;
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background-color: #1a8e79;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 2rem;
    box-shadow: 0 4px 6px rgba(26, 142, 121, 0.2);
}

.btn-primary-custom:hover {
    background-color: #0e4b3e;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(26, 142, 121, 0.3);
}

.btn-primary-custom:active {
    transform: translateY(1px);
}

/* Utilities */
.text-danger {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
}

.hidden {
    display: none !important;
}

.forgot-password {
    text-align: right;
    margin-top: 0.5rem;
}

.forgot-password a {
    color: #666;
    font-size: 0.85rem;
    text-decoration: none;
}

.forgot-password a:hover {
    color: #1a8e79;
}

/* Tablet & narrow desktop: stack so the form gets full width */
@media (max-width: 960px) {

    body,
    html {
        overflow: auto;
    }

    .split-screen {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .branding-panel {
        width: 100%;
        min-height: auto;
        padding: 2.25rem 1.5rem 1.75rem;
    }

    .branding-content {
        padding: 0;
    }

    .branding-logo {
        width: 96px;
        height: 96px;
        max-width: 96px;
        margin-bottom: 0.875rem;
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.14);
    }

    .branding-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .branding-subtitle {
        font-size: 1.25rem;
        margin-bottom: 0.625rem;
    }

    .branding-audience {
        font-size: 0.9rem;
        max-width: 38ch;
    }

    .branding-features {
        margin-top: 1.5rem;
        gap: 0.625rem;
        max-width: 480px;
    }

    .branding-features li {
        font-size: 0.9rem;
    }

    .branding-footer {
        position: static;
        margin-top: 1.5rem;
    }

    .form-panel {
        width: 100%;
        padding: 2rem 1.5rem;
        flex-grow: 1;
        min-height: auto;
    }
}

/* Phones: trim the feature list so the form is above the fold */
@media (max-width: 599px) {
    .branding-panel {
        padding: 1.5rem 1rem 1.25rem;
    }

    .branding-logo {
        width: 76px;
        height: 76px;
        max-width: 76px;
        margin-bottom: 0.625rem;
    }

    .branding-title {
        font-size: 1.6rem;
    }

    .branding-subtitle {
        font-size: 1.05rem;
        margin-bottom: 0.5rem;
    }

    .branding-audience {
        font-size: 0.82rem;
        max-width: 32ch;
    }

    .branding-features {
        display: none;
    }

    .branding-footer {
        margin-top: 1rem;
        gap: 0.5rem;
    }

    .branding-link {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
}

/* Respect reduced-motion: hold the gradient still and skip entrance fades */
@media (prefers-reduced-motion: reduce) {
    .branding-panel {
        animation: none;
        background-position: 0% 50%;
    }

    .input-group,
    .branding-subtitle span,
    .branding-features li {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .branding-link,
    .branding-link i,
    .btn-primary-custom {
        transition: none;
    }
}