/* AIST Telecommunications Portal - Professional Design */
:root {
    --primary: #00BCD4;
    --primary-dark: #0097A7;
    --primary-light: #4DD0E1;
    --primary-bg: #E0F7FA;
    --secondary: #FF5722;
    --accent: #FFC107;
    --success: #4CAF50;
    --danger: #F44336;
    --white: #FFFFFF;
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #BDBDBD;
    --gray-500: #9E9E9E;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    position: relative;
}

body[dir="rtl"] {
    font-family: "Heebo", "Manrope", -apple-system, sans-serif;
}

/* Main Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    margin: 20px;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo Section */
.logo-section {
    background: var(--white);
    padding: 48px 24px 32px;
    text-align: center;
    border-bottom: 1px solid var(--gray-200);
}

.logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.brand-name {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.brand-tagline {
    font-size: 14px;
    color: var(--gray-600);
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* Info Banner - Animated Tech Style */
.info-banner {
    margin-top: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 188, 212, 0.3);
}

.info-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate-glow 20s linear infinite;
}

@keyframes rotate-glow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Tech Animation Elements */
.tech-sparkle {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 60px;
    height: 60px;
    opacity: 0.1;
    animation: sparkle 3s ease-in-out infinite;
}

.tech-sparkle::before,
.tech-sparkle::after {
    content: '◈';
    position: absolute;
    font-size: 24px;
    color: white;
}

.tech-sparkle::before {
    top: 0;
    left: 0;
    transform: rotate(-15deg);
}

.tech-sparkle::after {
    bottom: 0;
    right: 0;
    transform: rotate(15deg);
    font-size: 18px;
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(0.9);
        opacity: 0.1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.2;
    }
}

.info-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: glow-text 2s ease-in-out infinite alternate;
    position: relative;
    z-index: 1;
}

@keyframes glow-text {
    0% {
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2),
                     0 0 20px rgba(255, 255, 255, 0.3);
    }
    100% {
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2),
                     0 0 30px rgba(255, 255, 255, 0.5);
    }
}

/* Form Section */
.form-section {
    padding: 32px 24px 24px;
}

.message {
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.message.error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border-left: 4px solid var(--danger);
}

.message.success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    border-left: 4px solid var(--success);
}

.message.show {
    display: block;
}

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

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--gray-50);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    color: var(--gray-900);
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(0, 188, 212, 0.1);
}

.form-links {
    text-align: right;
    margin-bottom: 24px;
}

[dir="rtl"] .form-links {
    text-align: left;
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

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

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

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

.submit-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(0, 188, 212, 0.3);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:active::before {
    width: 300px;
    height: 300px;
}

.submit-btn:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
}

.btn-text {
    position: relative;
    z-index: 1;
}

/* Loading Spinner */
.spinner {
    animation: spin 1s linear infinite;
}

.spinner .path {
    stroke: var(--white);
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Features Section */
.features-section {
    padding: 24px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.feature {
    text-align: center;
}

.feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    background: var(--primary-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    fill: var(--primary);
}

.feature-text {
    font-size: 13px;
    color: var(--gray-700);
    font-weight: 500;
}

/* Footer */
.footer-section {
    padding: 24px;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
}

.lang-switcher {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.lang-btn {
    padding: 8px 24px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.lang-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.lang-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Responsive */
@media (max-width: 480px) {
    .auth-card {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
    }
}

/* iOS Specific */
@supports (-webkit-touch-callout: none) {
    input {
        font-size: 16px !important;
    }
}
