* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 60px;
    position: relative;
}

.container {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 248, 220, 0.98) 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(139, 0, 0, 0.4), 0 0 0 1px rgba(255, 215, 0, 0.2);
    padding: 50px 60px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    animation: slideIn 0.5s ease-out;
    position: relative;
    z-index: 1;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

/* Horizontal container for access page */
.container-horizontal {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 248, 220, 0.98) 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(139, 0, 0, 0.4), 0 0 0 1px rgba(255, 215, 0, 0.2);
    padding: 40px;
    max-width: 1400px;
    width: 95%;
    animation: slideIn 0.5s ease-out;
    position: relative;
    z-index: 1;
    border: 2px solid rgba(255, 215, 0, 0.3);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

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

.logo-container {
    margin: 30px 0;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.logo {
    width: 200px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(139, 0, 0, 0.3), 0 0 0 2px rgba(255, 215, 0, 0.4);
}

h1 {
    color: #8B0000;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #8B0000;
    font-size: 1.8em;
    margin-bottom: 15px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    text-align: center;
    grid-column: 1 / -1;
}

.welcome-text {
    color: #666;
    font-size: 1.1em;
    margin: 20px 0;
    line-height: 1.6;
}

.company-name {
    color: #B8860B;
    font-weight: 700;
    font-size: 1.3em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 16px 40px;
    margin: 20px 10px;
    font-size: 1.1em;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 50%, #B8860B 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 0, 0, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 50%, #FFD700 100%);
    color: #8B0000;
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(184, 134, 11, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #DC143C 0%, #8B0000 50%, #B22222 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.4);
}

/* Left column - User info and token */
.left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Right column - Services */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* User Info Card */
.user-info {
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 50%, #B8860B 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(139, 0, 0, 0.4);
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.user-name {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.user-email {
    font-size: 1em;
    opacity: 0.9;
    margin-bottom: 15px;
}

/* Access Token Display */
.token-info {
    background: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.token-label {
    font-size: 0.85em;
    margin-bottom: 8px;
    opacity: 0.9;
    font-weight: 600;
}

.token-value {
    font-family: 'Courier New', monospace;
    font-size: 0.75em;
    word-break: break-all;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 6px;
    max-height: 80px;
    overflow-y: auto;
    text-align: left;
}

.session-info {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    margin-top: 15px;
    margin-bottom: 15px;
}

.timer {
    font-size: 1.5em;
    font-weight: 700;
    color: #fff;
    margin-top: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.timer.warning {
    color: #FFD700;
    animation: pulse 1s infinite;
}

.timer.danger {
    color: #FF6B6B;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Service Links */
.services-section {
    text-align: left;
}

.services-section h3 {
    color: #8B0000;
    font-size: 1.4em;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 3px solid #B8860B;
    padding-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.service-card {
    background: linear-gradient(135deg, #FFF8DC 0%, #F5DEB3 50%, #DEB887 100%);
    padding: 20px;
    border-radius: 15px;
    text-decoration: none;
    color: #8B0000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(139, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 100px;
    border: 2px solid rgba(184, 134, 11, 0.3);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(139, 0, 0, 0.4);
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 50%, #B8860B 100%);
    color: white;
    border-color: rgba(255, 215, 0, 0.6);
}

.service-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

/* Service icon images */
.service-icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon-img {
    transform: scale(1.1);
}

.service-name {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
}

.service-description {
    font-size: 0.9em;
    opacity: 0.8;
}

/* No Access Message */
.no-access {
    background: linear-gradient(135deg, #FFF8DC 0%, #F5DEB3 100%);
    color: #8B0000;
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid #B8860B;
    border: 2px solid rgba(184, 134, 11, 0.3);
}

/* Logout Message */
.logout-message {
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 50%, #FFD700 100%);
    color: #8B0000;
    padding: 25px;
    border-radius: 15px;
    margin: 25px 0;
    font-size: 1.1em;
    border: 2px solid rgba(139, 0, 0, 0.3);
}

.logout-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

/* Divider */
.divider {
    height: 3px;
    background: linear-gradient(90deg, transparent, #B8860B, #8B0000, #B8860B, transparent);
    margin: 30px 0;
    border-radius: 2px;
    grid-column: 1 / -1;
}

.logout-section {
    grid-column: 1 / -1;
    text-align: center;
}

/* Responsive */
@media (max-width: 1200px) {
    .container-horizontal {
        grid-template-columns: 1fr;
        max-width: 800px;
    }
}

@media (max-width: 768px) {
    .container, .container-horizontal {
        padding: 30px 25px;
        margin: 20px;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.5em;
    }

    .logo {
        width: 150px;
    }

    .btn {
        padding: 14px 30px;
        font-size: 1em;
    }

    .service-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Additional golden accents */
.container::before, .container-horizontal::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #B8860B, #FFD700, #B8860B);
    border-radius: 22px;
    z-index: -1;
    opacity: 0.3;
}

/* Password Button */
.password-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    margin-top: 15px;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.password-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Token Button - Golden variant */
.token-button {
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 50%, #FFD700 100%);
    color: #8B0000;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    margin-top: 15px;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(184, 134, 11, 0.3);
}

.token-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(218, 165, 32, 0.5);
    background: linear-gradient(135deg, #DAA520 0%, #FFD700 50%, #FFF8DC 100%);
}

/* Modal/Popup */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

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

.modal-header {
    font-size: 1.3em;
    color: #8B0000;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
}

.password-display {
    background: linear-gradient(135deg, #FFF8DC 0%, #F5DEB3 100%);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin: 20px 0;
    border: 2px solid rgba(184, 134, 11, 0.3);
}

.password-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 10px;
}

.password-text {
    font-family: 'Courier New', monospace;
    font-size: 1.3em;
    font-weight: 700;
    color: #8B0000;
    letter-spacing: 2px;
    word-break: break-all;
}

/* Token Modal */
.token-modal-content {
    max-width: 700px !important;
    width: 90%;
    margin: 10% auto;
}

.token-display {
    max-height: 200px;
    overflow-y: auto;
}

.token-text {
    font-size: 0.75em !important;
    font-weight: 500 !important;
    letter-spacing: 0.5px !important;
    line-height: 1.5;
    word-break: break-all;
    text-align: left;
    padding: 15px;
    background: rgba(0, 0, 0, 0.05);
}

/* Responsive adjustments for token modal */
@media (max-width: 768px) {
    .token-modal-content {
        max-width: 95% !important;
        margin: 5% auto;
    }
    
    .token-text {
        font-size: 0.65em !important;
    }
}

.copy-button {
    background: linear-gradient(135deg, #B8860B 0%, #DAA520 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.copy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.4);
}

.close-button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.close-button:hover {
    background: #c82333;
}

.copy-success {
    color: #28a745;
    font-size: 0.9em;
    margin-top: 10px;
    display: none;
}

/* Error Page Styles */
.error-container {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.error-code {
    font-size: 3em;
    color: #dc3545;
    font-weight: 700;
    margin-bottom: 10px;
}

.error-title {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.error-message {
    background: white;
    color: #666;
    font-size: 1em;
    line-height: 1.6;
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.error-container .btn {
    display: inline-block;
    padding: 12px 30px;
    margin-top: 20px;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: #007bff;
    color: white;
    transition: background 0.3s ease;
}

.error-container .btn:hover {
    background: #0056b3;
}

.help-text {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #888;
    font-size: 0.9em;
}

.help-text a {
    color: #007bff;
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

/* Error page specific body styling */
body.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    padding-top: 20px;
}
