/* Material Design Login Form - Complete & Self-Contained */

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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fafafa;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.5;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 48px 40px 36px;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.1),
        0 8px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.login-card:hover {
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.12),
        0 12px 28px rgba(0, 0, 0, 0.15);
}

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

.material-logo {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.logo-layers {
    position: relative;
    width: 56px;
    height: 56px;
}

.layer {
    position: absolute;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.layer-1 {
    width: 56px;
    height: 56px;
    background: #1976d2;
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.3);
}

.layer-2 {
    width: 40px;
    height: 40px;
    top: 8px;
    left: 8px;
    background: #2196f3;
    box-shadow: 0 1px 3px rgba(33, 150, 243, 0.3);
}

.layer-3 {
    width: 24px;
    height: 24px;
    top: 16px;
    left: 16px;
    background: #64b5f6;
    box-shadow: 0 1px 2px rgba(100, 181, 246, 0.3);
}

.material-logo:hover .layer-1 {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(25, 118, 210, 0.4);
}

.material-logo:hover .layer-2 {
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.4);
}

.material-logo:hover .layer-3 {
    transform: scale(1.2);
    box-shadow: 0 2px 4px rgba(100, 181, 246, 0.4);
}

.login-header h2 {
    color: #212121;
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 8px;
    letter-spacing: 0.15px;
}

.login-header p {
    color: #757575;
    font-size: 14px;
    font-weight: 400;
}

/* Material Form Groups */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.input-wrapper input {
    background: transparent;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    border-radius: 0;
    padding: 16px 0 8px;
    color: #212121;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.2s ease;
    width: 100%;
    outline: none;
    position: relative;
    z-index: 3;
}

.input-wrapper input:focus {
    border-bottom-color: #1976d2;
}

.input-wrapper input:focus + label,
.input-wrapper input:valid + label {
    transform: translateY(-24px) scale(0.75);
    color: #1976d2;
    font-weight: 500;
}

.input-wrapper label {
    position: absolute;
    left: 0;
    top: 16px;
    color: #757575;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.2s ease;
    pointer-events: none;
    transform-origin: left top;
    z-index: 4;
}

.input-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #1976d2;
    transition: width 0.2s ease;
    z-index: 5;
}

.input-wrapper input:focus ~ .input-line {
    width: 100%;
}

/* Material Ripple Effects */
.ripple-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(25, 118, 210, 0.2);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 56px;
}

.password-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #757575;
    transition: all 0.2s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 10;
}

.password-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #1976d2;
}

.toggle-ripple {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    overflow: hidden;
    z-index: 1;
}

.toggle-icon {
    display: block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23757575' stroke-width='1.5'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'/%3e%3c/svg%3e");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-image 0.2s ease;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.password-toggle:hover .toggle-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231976d2' stroke-width='1.5'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'/%3e%3c/svg%3e");
}

.toggle-icon.show-password {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23757575' stroke-width='1.5'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 11-4.243-4.243m4.242 4.242L9.88 9.88'/%3e%3c/svg%3e");
}

.password-toggle:hover .toggle-icon.show-password {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231976d2' stroke-width='1.5'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 11-4.243-4.243m4.242 4.242L9.88 9.88'/%3e%3c/svg%3e");
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    color: #424242;
    font-size: 14px;
    font-weight: 400;
}

.checkbox-material {
    position: relative;
    width: 18px;
    height: 18px;
    border: 2px solid #757575;
    border-radius: 2px;
    transition: all 0.2s ease;
    overflow: hidden;
    flex-shrink: 0;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-label .checkbox-material {
    background: #1976d2;
    border-color: #1976d2;
}

.checkbox-ripple {
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border-radius: 50%;
    overflow: hidden;
}

.checkbox-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    fill: white;
    opacity: 0;
    transition: all 0.2s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-label .checkbox-icon {
    opacity: 1;
}

.checkbox-path {
    stroke-dasharray: 16;
    stroke-dashoffset: 16;
    transition: stroke-dashoffset 0.3s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-label .checkbox-path {
    stroke-dashoffset: 0;
}

.forgot-password {
    color: #1976d2;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.25px;
}

.forgot-password:hover {
    color: #0d47a1;
}

/* Material Button */
.material-btn {
    width: 100%;
    background: #1976d2;
    border: none;
    border-radius: 4px;
    padding: 12px 24px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.25px;
    min-height: 48px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.material-btn:hover {
    background: #1565c0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.material-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-ripple {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.btn-text {
    position: relative;
    z-index: 1;
    transition: opacity 0.2s ease;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.loader-circle {
    width: 20px;
    height: 20px;
    animation: rotate 2s linear infinite;
}

.loader-path {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    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; }
}

.material-btn.loading .btn-text {
    opacity: 0;
}

.material-btn.loading .btn-loader {
    opacity: 1;
}

/* Divider */
.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
    transform: translateY(-50%);
}

.divider span {
    background: #ffffff;
    color: #757575;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

/* Social Login */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.social-btn {
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 12px 16px;
    color: #3c4043;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    min-height: 48px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.social-btn:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.social-ripple {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.social-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icon svg {
    width: 100%;
    height: 100%;
}

/* Signup Link */
.signup-link {
    text-align: center;
}

.signup-link p {
    color: #757575;
    font-size: 14px;
    font-weight: 400;
}

.create-account {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.create-account:hover {
    color: #0d47a1;
}

/* Error States */
.error-message {
    color: #d32f2f;
    font-size: 12px;
    font-weight: 400;
    margin-top: 6px;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

.form-group.error .input-wrapper input {
    border-bottom-color: #d32f2f;
    color: #d32f2f;
}

.form-group.error .input-wrapper label {
    color: #d32f2f;
}

.form-group.error .input-line {
    background: #d32f2f;
}

/* Success Message */
.success-message {
    display: none;
    text-align: center;
    padding: 32px 20px;
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.success-message.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.success-elevation {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.success-icon {
    width: 48px;
    height: 48px;
    background: #4caf50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.success-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.success-message h3 {
    color: #212121;
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.success-message p {
    color: #757575;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .login-card {
        padding: 32px 24px 24px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .logo-layers {
        width: 48px;
        height: 48px;
    }
    
    .layer-1 {
        width: 48px;
        height: 48px;
    }
    
    .layer-2 {
        width: 32px;
        height: 32px;
        top: 8px;
        left: 8px;
    }
    
    .layer-3 {
        width: 16px;
        height: 16px;
        top: 16px;
        left: 16px;
    }
}
/* === Accessibility: keyboard focus indicators === */
/* Restores visible focus rings for keyboard users without affecting mouse interaction. */
:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduced motion: respect user preference. Animations defined per form will tone down. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
