﻿:root {
    --primary-color: #0056b3;
    --secondary-color: #00a8ff;
    --dark-color: #1a1a1a;
    --light-color: #f8f9fa;
    --accent-color: #ff9f43;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
}

/* E-Signature Specific Styles */
.esignature-card-wrapper {
    max-width: 550px !important;
}

.certificate-section {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #eef0f2;
}

.certificate-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.nav-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-button:hover:not(:disabled) {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.1);
}

.nav-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.certificate-display {
    flex: 1;
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#current-certificate {
    font-weight: 600;
    color: var(--dark-color);
    display: block;
    margin-bottom: 4px;
    font-size: 1.05rem;
}

.certificate-dates {
    font-size: 0.85rem;
    color: #666;
    display: block;
}

.token_description {
    font-size: 0.8rem;
    color: var(--primary-color);
    display: block;
    margin-top: 4px;
}

.certificate-paging {
    font-size: 0.75rem;
    color: #999;
    margin-top: 8px;
    display: block;
}

.refresh-cert {
    margin: 10px auto 0;
}

/* Keypad Styles */
.keypad-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 16px;
}

.keypad-button {
    height: 50px;
    border-radius: 12px;
    border: 1px solid #eef0f2;
    background: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.keypad-button:hover {
    background: var(--light-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.keypad-button.clear {
    color: var(--danger-color);
}

.keypad-button.backspace {
    color: var(--primary-color);
}

.signature-text-link {
    text-align: center;
    margin: 20px 0;
}

.signature-text-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.signature-text-link a:hover {
    text-decoration: underline;
}

/* Modal Styles */
.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(5px);
    overflow-y: auto;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 24px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    position: relative;
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--dark-color);
}

.signature-text-content h3 {
    margin-top: 0;
    color: var(--dark-color);
    text-align: center;
    margin-bottom: 20px;
}

#declaration {
    width: 100%;
    min-height: 300px;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eef0f2;
    background-color: #fcfcfc;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
}

.signature-date {
    margin-top: 20px;
    text-align: right;
    font-style: italic;
    color: #666;
    font-size: 0.85rem;
}

.error-message {
    color: var(--danger-color);
    background: rgba(220, 53, 69, 0.1);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 15px;
    display: none;
    border-left: 4px solid var(--danger-color);
}

.warnings {
    margin-bottom: 15px;
}

.warnings p {
    color: var(--warning-color);
    background: rgba(255, 193, 7, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    margin: 4px 0;
}

/* Social icons enhancement for back links */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #eef0f2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: all 0.2s;
    text-decoration: none;
    position: relative;
}

.social-icon:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
}

.social-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-color);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 8px;
}

.social-icon:hover::after {
    opacity: 1;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-gradient);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-page-container {
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card-wrapper {
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-right: 12px;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
    letter-spacing: -0.5px;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 0.95rem;
}

.method-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.method-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.method-card-inner {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #fff;
    border: 1px solid #eef0f2;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.method-card:hover .method-card-inner {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

.method-icon-bg {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-right: 20px;
    flex-shrink: 0;
}

.password-bg { background: rgba(0, 86, 179, 0.1); color: #0056b3; }
.eimza-bg { background: rgba(0, 168, 255, 0.1); color: #00a8ff; }
.passwordless-bg { background: rgba(255, 159, 67, 0.1); color: #ff9f43; }

.method-details {
    flex-grow: 1;
}

.method-details h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--dark-color);
}

.method-details p {
    font-size: 0.85rem;
    color: #777;
    margin: 0;
}

.method-action {
    color: #ccc;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.method-card:hover .method-action {
    color: var(--primary-color);
    transform: translateX(4px);
}

.login-footer {
    margin-top: 40px;
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.login-footer p {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner-container {
    text-align: center;
}

#loading-status {
    margin-top: 15px;
    font-weight: 500;
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 576px) {
    .login-card-wrapper {
        padding: 30px 20px;
        border-radius: 0;
        min-height: 100vh;
        max-width: none;
    }
    
    body {
        background: #fff;
    }
    
    .method-card-inner {
        padding: 16px;
    }
}

/* Form Styles for Sub-Login Pages */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.input-icon-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-container input {
    width: 100%;
    padding: 12px 16px 12px 45px;
    border: 1.5px solid #eef0f2;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #fcfdfe;
}

.input-icon-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.1);
    background: #fff;
}

.input-icon-container .input-icon {
    position: absolute;
    left: 16px;
    color: #a0aec0;
    font-size: 1.1rem;
    pointer-events: none;
}

.input-icon-container .input-icon.clickable {
    left: auto;
    right: 16px;
    pointer-events: auto;
    cursor: pointer;
}

.login-button {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.2);
}

.login-button:hover {
    background: #004494;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 86, 179, 0.3);
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.85rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    cursor: pointer;
}

.remember-me input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.forgot-password, .back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-password:hover, .back-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.back-link {
    display: inline-block;
    margin-top: 25px;
    font-size: 0.9rem;
}

.error-message {
    color: #e53e3e;
    font-size: 0.8rem;
    margin-top: 6px;
    display: none;
}

.notification-message, .notification-info-message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.notification-message {
    background: rgba(229, 62, 62, 0.1);
    border: 1px solid rgba(229, 62, 62, 0.2);
    color: #c53030;
}

.notification-info-message {
    background: rgba(49, 130, 206, 0.1);
    border: 1px solid rgba(49, 130, 206, 0.2);
    color: #2b6cb0;
}

.login-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8fafc;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #4a5568;
    line-height: 1.5;
}

.status-container {
    display: none;
    text-align: center;
}

.status-container.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.status-icon.success {
    width: 60px;
    height: 60px;
    background: #48bb78;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
    box-shadow: 0 10px 20px rgba(72, 187, 120, 0.2);
}

.status-text.success {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2f855a;
    margin-bottom: 15px;
}

.password-requirements {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 8px;
    font-style: italic;
}

.social-login {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #edf2f7;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.social-icon:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-3px);
}