/**************************************************************/
/* CIP Login — UI Override Stylesheet                          */
/* Load AFTER pro-login.css:                                   */
/* <link href="/Content/assets/css/pro-login.css" rel="stylesheet" /> */
/* <link href="/Content/assets/css/pro-login-override.css" rel="stylesheet" /> */
/**************************************************************/

:root {
    --cip-gold: #c7974f;
    --cip-gold-dark: #a97e3d;
    --cip-navy: #0f2a3d;
    --cip-navy-deep: #0a1c2b;
    --cip-text: #1f2733;
    --cip-muted: #6b7280;
    --cip-danger: #d64545;
    --cip-success: #1e8e5a;
    --cip-radius: 14px;
    --cip-radius-sm: 10px;
}

/* ---------------------------------------------------------- */
/* Background — Boursa Kuwait trading floor photo              */
/* File: /Content/assets/images/boursa-kuwait-bg.jpg            */
/* ---------------------------------------------------------- */
body {
    font-family: 'Tajawal', 'Segoe UI', sans-serif;
    background-image:
        linear-gradient(160deg, rgba(8, 20, 30, 0.86) 0%, rgba(10, 28, 43, 0.68) 40%, rgba(70, 35, 15, 0.45) 100%),
        url('../../../Content/assets/images/boursa-kuwait-bg.jpg');
    background-size: cover;
    background-position: center 35%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Subtle vignette + gold sheen to tie the warm trading-floor tones together */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 10%, rgba(199, 151, 79, 0.16), transparent 45%),
                radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.5), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ---------------------------------------------------------- */
/* Card container                                               */
/* ---------------------------------------------------------- */
.login-container {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 36px 34px 28px;
    border-radius: var(--cip-radius);
    width: 100%;
    max-width: 400px;
    box-shadow:
        0 24px 48px -12px rgba(10, 28, 43, 0.45),
        0 0 0 1px rgba(199, 151, 79, 0.15);
    text-align: center;
    border-top: 4px solid var(--cip-gold);
    animation: cip-card-in 0.45s ease-out;
}

@keyframes cip-card-in {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------------------------------------------------------- */
/* Logo + Title                                                 */
/* ---------------------------------------------------------- */
.login-logo {
    width: 88px !important;
    height: 88px !important;
    object-fit: contain;
    margin-bottom: 14px;
    padding: 10px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 16px rgba(10, 28, 43, 0.18);
    border: 1px solid rgba(199, 151, 79, 0.25);
}

.login-container h2 {
    margin-bottom: 22px;
    font-size: 1.15rem !important;
    font-weight: 700;
    color: var(--cip-navy);
    letter-spacing: 0.2px;
    padding: 0 !important;
}

.login-container h2::after {
    content: "";
    display: block;
    width: 42px;
    height: 3px;
    margin: 10px auto 0;
    background: linear-gradient(90deg, var(--cip-gold), var(--cip-gold-dark));
    border-radius: 2px;
}

/* ---------------------------------------------------------- */
/* Form labels                                                  */
/* ---------------------------------------------------------- */
.form-label {
    display: block;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cip-navy);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ---------------------------------------------------------- */
/* Inputs                                                       */
/* ---------------------------------------------------------- */
.form-control {
    width: 100%;
    padding: 12px 14px !important;
    margin-bottom: 4px !important;
    border-radius: var(--cip-radius-sm) !important;
    border: 1.5px solid #e2e5ea !important;
    background-color: #f9fafb !important;
    font-size: 0.95rem !important;
    color: var(--cip-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control::placeholder {
    color: #9aa3af;
    font-size: 0.88rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--cip-gold) !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(199, 151, 79, 0.16) !important;
}

.form-control:hover:not(:focus) {
    border-color: #c9ccd2 !important;
}

.mb-4 {
    margin-bottom: 18px !important;
    text-align: left;
}

/* Captcha image styling */
.mb-4 img[alt="Captcha Code"] {
    border-radius: var(--cip-radius-sm);
    border: 1px solid #e2e5ea;
    height: 48px;
    display: block;
    margin: 0 auto 10px;
    box-shadow: 0 2px 6px rgba(10, 28, 43, 0.08);
}

/* ---------------------------------------------------------- */
/* Validation / status messages                                 */
/* ---------------------------------------------------------- */
.text-danger {
    color: var(--cip-danger) !important;
    font-size: 0.82rem;
    background: rgba(214, 69, 69, 0.08);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px !important;
    display: block;
}

.text-danger:empty,
.text-success:empty {
    display: none;
    padding: 0;
    margin: 0 !important;
}

.text-success {
    color: var(--cip-success) !important;
    font-size: 0.82rem;
    background: rgba(30, 142, 90, 0.08);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px !important;
    display: block;
}

/* ---------------------------------------------------------- */
/* Primary button                                                */
/* ---------------------------------------------------------- */
.custom-btn-primary {
    width: 100%;
    padding: 13px !important;
    background: linear-gradient(135deg, var(--cip-gold) 0%, var(--cip-gold-dark) 100%) !important;
    border: none !important;
    border-radius: var(--cip-radius-sm) !important;
    color: #fff !important;
    font-size: 1rem !important;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 8px 18px -6px rgba(199, 151, 79, 0.55);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.custom-btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
    box-shadow: 0 12px 22px -6px rgba(199, 151, 79, 0.6);
}

.custom-btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 10px -4px rgba(199, 151, 79, 0.5);
}

.custom-btn-primary:focus-visible {
    outline: 2px solid var(--cip-navy);
    outline-offset: 2px;
}

#submitBtn {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* Spinner */
.btn-spinner {
    width: 17px;
    height: 17px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: cip-spin 0.65s linear infinite;
}

@keyframes cip-spin {
    to { transform: rotate(360deg); }
}

#submitBtn.loading .btn-text {
    opacity: 0.75;
}

#submitBtn.loading .btn-spinner {
    display: inline-block;
}

#submitBtn.loading {
    pointer-events: none;
    opacity: 0.92;
}

/* ---------------------------------------------------------- */
/* Footer link                                                   */
/* ---------------------------------------------------------- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    color: var(--cip-muted);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--cip-gold-dark);
    text-decoration: none;
}

.back-link::before {
    content: "\21bb";
    font-size: 0.95rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.back-link:hover::before {
    transform: rotate(180deg);
}

/* ---------------------------------------------------------- */
/* Mobile refinements                                            */
/* ---------------------------------------------------------- */
@media (max-width: 600px) {
    .login-container {
        padding: 28px 22px 22px;
        max-width: 92vw;
        border-radius: 12px;
    }

    .login-logo {
        width: 72px !important;
        height: 72px !important;
    }

    .login-container h2 {
        font-size: 1.02rem !important;
    }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .login-container,
    .custom-btn-primary,
    .back-link::before {
        animation: none !important;
        transition: none !important;
    }
}
