/* Modern Login CSS */
:root {
    --primary-color: #d32f2f;
    --primary-hover: #b71c1c;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #d1d5db;
    --focus-ring: rgba(211, 47, 47, 0.25);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
    background-size: 20px 20px;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
}

.login-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: #f8fafc;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 24px 24px;
    perspective: 1000px;
    /* 3D perspective */
}

/* FLIP CARD CONTAINER */
.flip-card {
    background-color: transparent;
    width: 100%;
    max-width: 420px;
    height: 550px;
    /* Fixed height for flip effect */
    position: relative;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

/* FLIP ACTION */
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

/* FRONT & BACK FACES */
.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.flip-card-front {
    background-color: white;
    z-index: 2;
}

.flip-card-back {
    background-color: white;
    transform: rotateY(180deg);
    z-index: 1;
}

/* Inner Card Content Adjustment */
.login-card {
    width: 100%;
    height: 100%;
    padding: 40px;
    background: white;
    border-radius: 24px;
    display: flex;
    /* Flexbox for vertical alignment */
    flex-direction: column;
    justify-content: center;
    /* Center content vertically */
    box-sizing: border-box;
    /* Padding included in width/height */
}

.brand-logo {
    text-align: center;
    margin-bottom: 24px;
}

.brand-logo img {
    max-width: 180px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

.login-header p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: #fff;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-secondary);
    user-select: none;
}

.remember-me input {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background-color: var(--primary-color);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(211, 47, 47, 0.2);
}

.btn-login:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -1px rgba(211, 47, 47, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #64748b;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background-color: #f1f5f9;
    color: #475569;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.back-link:hover {
    background-color: #fee2e2;
    color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.1);
}

.back-link i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.back-link:hover i {
    transform: translateX(-4px);
}

.login-footer p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

/* Custom Success Modal */
.custom-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal.show {
    display: flex;
    opacity: 1;
}

.custom-modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal.show .custom-modal-content {
    transform: scale(1);
}

.success-icon {
    font-size: 64px;
    color: #10b981;
    /* Emerald 500 */
    margin-bottom: 20px;
}

.custom-modal-content h3 {
    color: #1e293b;
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 600;
}

.custom-modal-content p {
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.5;
}