/* * Linkly - Master Stylesheet (Täydellinen versio)
 * Sisältää: Brändivärit, Apple-tyyli, Modernit inputit, Profiili, Dashboard & Animaatiot
 */

 @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

 :root {
     /* Brändivärit (Kuvasta poimitut) */
     --bg-color: #F7F8F0;           /* Luonnonvalkoinen/Beige */
     --primary: #355872;            /* Syvä tummansininen */
     --primary-hover: #4a718f;
     --accent: #9CD5FF;             /* Kirkas vaaleansininen */
     --text-main: #355872;
     --text-muted: #7AAACE;
     
     /* Rakenteelliset muuttujat */
     --card-bg: rgba(255, 255, 255, 0.75);
     --border-color: rgba(53, 88, 114, 0.1);
     --glass-border: rgba(255, 255, 255, 0.5);
     --danger: #ff3b30;
     --radius: 24px;
     --shadow: 0 12px 40px 0 rgba(53, 88, 114, 0.08);
     --blur: blur(25px);
 }
 
 /* TUMMA TEEMA (Aktivoituu .dark luokalla) */
 html.dark {
     --bg-color: #0f172a;           /* Syvä yönsininen */
     --card-bg: rgba(30, 41, 59, 0.75);
     --text-main: #F7F8F0;
     --text-muted: #9CD5FF;
     --border-color: rgba(156, 213, 255, 0.15);
     --glass-border: rgba(255, 255, 255, 0.05);
     --shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
 }
 
 /* --- PERUSRAKENNE --- */
 html { 
     transition: background-color 0.4s ease; 
     scroll-behavior: smooth; 
 }
 
 * { 
     box-sizing: border-box; 
     margin: 0; 
     padding: 0; 
     transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
 }
 
 body {
     font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
     background-color: var(--bg-color);
     color: var(--text-main);
     line-height: 1.47;
     -webkit-font-smoothing: antialiased;
     min-height: 100vh;
     padding-top: 75px; 
     padding-bottom: 120px; 
 }
 
 .container {
     max-width: 800px;
     margin: 0 auto;
     padding: 0 1.25rem;
 }
 
 /* --- YLÄPALKKI (HEADER) --- */
 .nav-wrapper {
     background-color: var(--card-bg);
     backdrop-filter: var(--blur);
     -webkit-backdrop-filter: var(--blur);
     border-bottom: 1px solid var(--border-color);
     position: fixed;
     top: 0; left: 0; right: 0;
     z-index: 1000;
     height: 60px;
     display: flex;
     align-items: center;
 }
 
 .nav-content {
     display: flex;
     justify-content: space-between;
     align-items: center;
     width: 100%;
 }
 
 .nav-left, .nav-right {
     display: flex;
     align-items: center;
     gap: 1rem;
 }
 
 .logo-img {
     height: 26px;
     width: auto;
     display: block;
 }
 
 html.dark .logo-img {
     filter: brightness(0) invert(1);
 }
 
 /* --- MODERNISOIDUT LOMAKKEET --- */
 label {
     display: block;
     text-align: center;
     width: 100%;
     font-size: 0.8rem;
     font-weight: 800;
     text-transform: uppercase;
     letter-spacing: 0.12em;
     color: var(--text-muted);
     margin-bottom: 0.8rem;
 }
 
 .input {
     width: 100%;
     padding: 1.2rem 1.5rem;
     border-radius: 18px;
     border: 2px solid var(--border-color);
     background: rgba(53, 88, 114, 0.03);
     color: var(--primary);
     font-family: 'Inter', sans-serif;
     font-size: 1.25rem;
     font-weight: 700;
     text-align: center;
     outline: none;
     transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
 }
 
 input[type="password"] {
     letter-spacing: 0.35em;
     font-size: 1.5rem;
 }
 
 .input::placeholder {
     color: var(--text-muted);
     font-weight: 500;
     opacity: 0.5;
     letter-spacing: normal;
     font-size: 1.1rem;
 }
 
 .input:focus {
     background: #ffffff;
     border-color: var(--primary);
     box-shadow: 0 0 0 5px rgba(53, 88, 114, 0.1);
     transform: scale(1.01);
 }
 
 html.dark .input {
     background: rgba(255, 255, 255, 0.05);
 }
 
 /* --- KOMPONENTIT: KORTIT & NAPIT --- */
 .card {
     background: var(--card-bg);
     backdrop-filter: var(--blur);
     -webkit-backdrop-filter: var(--blur);
     border: 1px solid var(--glass-border);
     border-radius: var(--radius);
     padding: 1.5rem;
     box-shadow: var(--shadow);
     margin-bottom: 1.25rem;
 }
 
 .btn {
     display: inline-flex;
     align-items: center;
     justify-content: center;
     padding: 0.8rem 1.6rem;
     border-radius: 22px;
     font-weight: 700;
     font-size: 1rem;
     cursor: pointer;
     border: none;
     text-decoration: none;
     gap: 0.5rem;
     transition: all 0.2s ease;
 }
 
 .btn-primary {
     background: var(--primary);
     color: #F7F8F0;
     box-shadow: 0 4px 15px rgba(53, 88, 114, 0.2);
 }
 
 .btn-primary:hover {
     background: var(--primary-hover);
     transform: translateY(-2px);
     box-shadow: 0 6px 20px rgba(53, 88, 114, 0.3);
 }
 
 .btn-primary:active { transform: scale(0.98); }
 
 .badge {
     font-size: 0.65rem;
     padding: 4px 10px;
     border-radius: 8px;
     background: rgba(156, 213, 255, 0.2);
     color: var(--primary);
     font-weight: 800;
     text-transform: uppercase;
     letter-spacing: 0.02em;
 }
 
 /* --- PROFIILISIVUN RAKENTEET --- */
 .profile-header {
     text-align: center;
     padding: 1rem 0 2.5rem;
 }
 
 .avatar-container {
     position: relative;
     width: 110px;
     height: 110px;
     margin: 0 auto 1.5rem;
 }
 
 .avatar-large {
     width: 110px;
     height: 110px;
     border-radius: 50%;
     object-fit: cover;
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 2.75rem;
     font-weight: 800;
     color: white;
     background: linear-gradient(135deg, var(--primary), var(--primary-hover));
     box-shadow: var(--shadow);
     border: 4px solid var(--card-bg);
 }
 
 .avatar-edit-badge {
     position: absolute;
     bottom: 4px;
     right: 4px;
     background: var(--primary);
     color: white;
     width: 36px;
     height: 36px;
     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     border: 3px solid var(--bg-color);
     cursor: pointer;
     box-shadow: 0 4px 10px rgba(0,0,0,0.2);
 }
 
 .settings-group {
     margin-bottom: 2.5rem;
 }
 
 .settings-group-title {
     font-size: 0.8rem;
     font-weight: 700;
     text-transform: uppercase;
     color: var(--text-muted);
     letter-spacing: 0.06em;
     margin-bottom: 0.75rem;
     padding-left: 1rem;
 }
 
 .settings-list {
     background: var(--card-bg);
     border-radius: var(--radius);
     border: 1px solid var(--glass-border);
     overflow: hidden;
     box-shadow: var(--shadow);
 }
 
 .settings-item {
     display: flex;
     flex-direction: column;
     align-items: center;
     padding: 1.5rem;
     border-bottom: 1px solid var(--border-color);
     text-decoration: none;
     color: var(--text-main);
     transition: background 0.2s;
     gap: 1rem;
 }
 
 .settings-item:last-child {
     border-bottom: none;
 }
 
 .settings-item:active {
     background: rgba(53, 88, 114, 0.06);
 }
 
 .settings-item-info {
     display: flex;
     align-items: center;
     gap: 1.25rem;
     width: 100%;
     justify-content: center;
 }
 
 .settings-item-icon {
     width: 36px;
     height: 36px;
     background: rgba(156, 213, 255, 0.15);
     border-radius: 10px;
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 1.2rem;
     color: var(--primary);
 }
 
 .settings-item-label {
     font-weight: 700;
     font-size: 1rem;
 }
 
 /* --- TALLENNUSPALKKI JA ANIMAATIOT --- */
 .save-bar {
     position: fixed;
     top: 75px;
     left: 50%;
     transform: translateX(-50%);
     width: 90%;
     max-width: 420px;
     background: var(--primary);
     color: white;
     padding: 0.8rem 1.5rem;
     border-radius: 16px;
     display: flex;
     justify-content: space-between;
     align-items: center;
     box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
     z-index: 2000;
     animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
 }
 
 @keyframes slideDown {
     from { transform: translate(-50%, -20px); opacity: 0; }
     to { transform: translate(-50%, 0); opacity: 1; }
 }
 
 /* --- DASHBOARD-ERITYISET --- */
 .link-item {
     display: flex;
     align-items: center;
     justify-content: space-between;
     padding: 1rem 0;
     border-bottom: 1px solid var(--border-color);
 }
 
 .link-item:last-child {
     border-bottom: none;
 }
 
 /* --- KELLUVA ALAVALIKKO --- */
 .nav-scrim {
     position: fixed;
     bottom: 0; left: 0; right: 0;
     height: 120px;
     background: linear-gradient(to top, var(--bg-color) 40%, transparent 100%);
     pointer-events: none;
     z-index: 90;
 }
 
 .floating-nav {
     position: fixed;
     bottom: 30px;
     left: 50%;
     transform: translateX(-50%);
     width: calc(100% - 32px);
     max-width: 420px;
     background: var(--card-bg);
     backdrop-filter: var(--blur);
     -webkit-backdrop-filter: var(--blur);
     display: flex;
     justify-content: space-around;
     padding: 10px;
     border-radius: 40px;
     border: 1px solid var(--glass-border);
     box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
     z-index: 1000;
 }
 
 .floating-nav a {
     color: var(--text-muted);
     padding: 12px;
     border-radius: 50%;
     display: flex;
     align-items: center;
     text-decoration: none;
     transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
 }
 
 .floating-nav a.active {
     background: rgba(53, 88, 114, 0.1);
     color: var(--primary);
     padding: 12px 22px;
     border-radius: 30px;
     gap: 10px;
 }
 
 .floating-nav a span {
     max-width: 0;
     overflow: hidden;
     opacity: 0;
     font-size: 0.9rem;
     font-weight: 700;
     transition: all 0.3s ease;
 }
 
 .floating-nav a.active span {
     max-width: 100px;
     opacity: 1;
 }
 
 .floating-nav svg {
     width: 24px;
     height: 24px;
     stroke-width: 2.2;
     stroke: currentColor;
     fill: none;
 }
 
 /* --- TIIMIN VALINTA --- */
 .team-select-wrapper { position: relative; }
 .team-select {
     background: transparent;
     border: none;
     font-family: inherit;
     font-weight: 800;
     font-size: 1.1rem;
     color: var(--text-main);
     cursor: pointer;
     outline: none;
     appearance: none;
     padding-right: 20px;
     letter-spacing: -0.02em;
 }
 
 .team-select-wrapper::after {
     content: '↓';
     font-size: 0.8rem;
     color: var(--primary);
     position: absolute;
     right: 0; top: 50%;
     transform: translateY(-50%);
     pointer-events: none;
     font-weight: 900;
 }
 
 /* --- AUTH-SIVUJEN RAKENTEET (Uudet) --- */
 .auth-wrapper {
     display: flex;
     align-items: center;
     justify-content: center;
     min-height: 75vh;
     padding: 1rem;
 }
 
 .auth-card {
     width: 100%;
     max-width: 440px;
     padding: 3rem 2.5rem;
     text-align: center;
 }
 
 .auth-logo {
     height: 36px;
     width: auto;
     margin: 0 auto 1.5rem;
     display: block;
 }
 /* Tumman teeman logo-muunnos */
html.dark .auth-logo {
    filter: brightness(0) invert(1);
}
 
 .auth-title {
     font-size: 1.7rem;
     font-weight: 800;
     color: var(--text-main);
     letter-spacing: -0.02em;
     margin-bottom: 0.5rem;
 }
 
 .auth-subtitle {
     color: var(--text-muted);
     font-size: 0.95rem;
     margin-top: 0.75rem;
     margin-bottom: 2rem;
     font-weight: 500;
 }
 
 .auth-status {
     padding: 1.2rem;
     border-radius: 18px;
     margin-bottom: 1.5rem;
     font-weight: 700;
     font-size: 0.95rem;
 }
 
 .auth-status.success {
     background: rgba(156, 213, 255, 0.15);
     color: var(--primary);
     border: 1px solid var(--border-color);
 }
 
 .auth-status.error {
     background: rgba(255, 59, 48, 0.1);
     color: var(--danger);
 }
 
 .auth-footer { margin-top: 2rem; }
 
 .auth-link {
     color: var(--text-muted);
     font-size: 0.9rem;
     text-decoration: none;
     font-weight: 700;
     display: inline-flex;
     align-items: center;
     gap: 8px;
 }
 
 /* --- FOOTER --- */
 .site-footer {
     padding: 2rem 0 8rem;
     text-align: center;
     font-size: 0.8rem;
     color: var(--text-muted);
 }
 
 /* --- MUISTA MINUT -PILLERI (SWITCH) --- */
 .switch-container {
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 12px;
     margin-bottom: 2rem;
     cursor: pointer;
     user-select: none;
 }
 
 .switch {
     position: relative;
     display: inline-block;
     width: 44px;
     height: 24px;
 }
 
 .switch input { 
     opacity: 0;
     width: 0;
     height: 0;
 }
 
 .slider {
     position: absolute;
     cursor: pointer;
     top: 0; left: 0; right: 0; bottom: 0;
     background-color: rgba(53, 88, 114, 0.1);
     transition: .4s;
     border-radius: 24px;
 }
 
 .slider:before {
     position: absolute;
     content: "";
     height: 18px;
     width: 18px;
     left: 3px;
     bottom: 3px;
     background-color: white;
     transition: .4s;
     border-radius: 50%;
     box-shadow: 0 2px 4px rgba(0,0,0,0.1);
 }
 
 input:checked + .slider {
     background-color: var(--primary);
 }
 
 input:checked + .slider:before {
     transform: translateX(20px);
 }
 
 .switch-label {
     font-size: 0.9rem;
     font-weight: 700;
     color: var(--text-main);
     text-transform: none;
     letter-spacing: 0;
     margin: 0;
     text-align: left;
     width: auto;
 }